package 代码记录.校招笔试真题.笔试真题_2023.极致游戏;

/**
 * @author zx
 * @create 2023-02-23 21:51
 * 路径总和
 * 当时居然完全想不到
 */
public class Test3 {
    /**
    public boolean hasPathSum(TreeNode root, int targetSum) {
        if(root == null){
            return false;
        }
        if(root.left == null && root.right == null){
            return targetSum == root.val;
        }
        return hasPathSum(root.left,targetSum - root.val) ||
                hasPathSum(root.right,targetSum - root.val);
    }
     */
}
